package routers

import (
	"github.com/gin-gonic/gin"
	v1 "perfect-admin/api/v1"
	"perfect-admin/middleware"
)

func InitUserRouter(Router *gin.RouterGroup)  {
	UserGroup := Router.Group("users").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
	{
		UserGroup.GET("/getUserList", v1.GetUserList)
		UserGroup.PUT("/changeState", v1.ChangeState)
		UserGroup.PUT("/updateRole", v1.UpdateUserRole)
		UserGroup.POST("/addOneUser", v1.AddOneUser)
		UserGroup.PUT("/updateUser", v1.UpdateUser)
		UserGroup.DELETE("/deleteUser", v1.DeleteUser)
		UserGroup.POST("/uploadAvatarImg", v1.UploadAvatarImg)
		UserGroup.PUT("/resetPassword", v1.ResetPwd)
	}
}
